package minimips.isa.itype;

import minimips.isa.RegisterWritingInstruction;

public abstract class RegisterWritingITypeInstruction extends RegisterWritingInstruction {

	private ITypeSpecification properties;
	
	public RegisterWritingITypeInstruction(long memoryAddress, int opcode,
			String instructionToken, int rs, int rt, int immediate) {
		super(memoryAddress, opcode, instructionToken);
		this.properties = new ITypeSpecification(opcode, rs, rt, immediate);
	}

	public int getOpcode() {
		return properties.getOpcode();
	}

	public int getRs() {
		return properties.getRs();
	}

	public int getRt() {
		return properties.getRt();
	}

	public int getImmediate() {
		return properties.getImmediate();
	}

	public int getMachineCode() {
		return properties.getMachineCode();
	}
	
	@Override
	public String toString() {
		return this.getInstructionName() + " " + properties.getRs() + ", " + properties.getRt() + ", " + properties.getImmediate();
	}

}
